class AccountsMailer < ActionMailer::Base
  def signup_notification(accounts)
    setup_email(accounts)
    @subject    += 'Please activate your new account'
  
    @body[:url]  = "http://localhost:3000/activate/#{accounts.activation_code}"
  
  end
  
  def activation(accounts)
    setup_email(accounts)
    @subject    += 'Your account has been activated!'
    @body[:url]  = "http://localhost:3000/"
  end
  
  protected
    def setup_email(accounts)
      @recipients  = "#{accounts.email}"
      @from        = "betang@ohimy.com"
      @subject     = "http://localhost:3000/ "
      @sent_on     = Time.now
      @body[:accounts] = accounts
    end
end
